#ifndef TIPOSFILESYSTEM_H_
#define TIPOSFILESYSTEM_H_

typedef struct {
	unsigned char jumpInstruction[3];//3bytes
	unsigned char OEMName[8];//8bytes
	uint16_t bytesSector;//2bytes
	unsigned char sectoresCluster;//1byte
	uint16_t sectoresReservados;//2bytes
	unsigned char cantidadTablasFat;//1byte
	uint16_t rootDirectoryEntries;//2bytes
	uint16_t sectoresTotales;//2bytes
	unsigned char mediaDescriptor;//1byte
	uint16_t sectoresPorFat_12_16;//2bytes
	uint16_t sectoresPorPista;//2bytes
	uint16_t cantidadCabezas;//2bytes
	uint32_t sectoresOcultos;//4bytes
	uint32_t sectoresTotales2;//4bytes
	uint32_t sectoresPorFat;//4bytes
	uint16_t FatFlags;//2bytes
	uint16_t version;//2bytes
	uint32_t rootDirectoryCluster;//4bytes
	uint16_t sectorFSInformationSector;//2bytes
	uint16_t sectorInicioCopyBootSector;//2bytes
	unsigned char reserved[12];//12bytes
	unsigned char physicalDriveNumber;//1byte
	unsigned char reserved2;//1byte
	unsigned char extendedBootSignature;//1byte
	uint32_t volumeId;//4bytes
	unsigned char volumeLabel[11];//11bytes
	unsigned char FSType[8];//8bytes
	unsigned char OperatingSystemBootCode[420];//420bytes
	uint16_t bootSectorSignature;//2bytes
} __attribute__((packed)) t_fat32_bootSector ;

typedef struct nodoCluster {
	int32_t numCluster;
	struct nodoCluster *sig;
} __attribute__((packed)) nodoCluster ;

typedef struct{
	unsigned char fileName[8];
	unsigned char fileExtension[3];
	uint8_t fileAttributes;
	uint8_t reserved;
	uint8_t createTimeFineResolution;
	uint16_t createTime;
	uint16_t createDate;
	uint16_t lastAccessDate;
	uint16_t high2BytesOfCluster;
	uint16_t lastModifiedTime;
	uint16_t lastModifiedDate;
	uint16_t low2BytesOfCluster;
	uint32_t fileSize;//EN BYTES
} __attribute__((packed)) t_registroDirectorio ;

typedef struct infoArchivoODirectorio{
	char name[13];
	char extension[13];
	uint8_t attributes;
	uint8_t reserved;
	uint8_t createTimeFineResolution;
	uint16_t createTime;
	uint16_t createDate;
	uint16_t lastAccessDate;
	uint16_t clusterHighTwoBytes;
	uint16_t lastModifiedTime;
	uint16_t lastModifiedDate;
	uint16_t clusterLowTwoBytes;
	uint32_t size;
} __attribute__((packed)) infoArchivoODirectorio;

typedef struct t_longFileName{
	uint8_t secuenceNumber;
	uint16_t nameCharacters1[5];
	uint8_t attributes;
	uint8_t reserved;
	uint8_t checksum;
	uint16_t nameCharacters2[6];
	uint16_t firstCluster;
	uint16_t nameCharacters3[2];
} __attribute__((packed)) t_longFileName;

typedef struct nodoLongFileName{
	t_longFileName longFileName;
	struct nodoLongFileName *sig;
} __attribute__((packed)) nodoLongFileName;

typedef struct{
	int32_t argc;
	int32_t* res;
	char** argv;
}__attribute__ ((packed)) t_argFUSE;

#endif /* TIPOSFILESYSTEM_H_ */
